
<template>
  <div class="zhihu">
<!--    <div class="aa"></div>-->
<!--    <div class="bb"></div>-->
    <div class="cc"></div>
  </div>
</template>
<script lang="ts">

export default {

}
</script>

<style scoped lang='scss'>
/*中心点*/
.aa{
  width: 20px;
  height: 20px;
  background-color: black;
  border-radius:50%;
  /*定位，相对body设置绝对定位*/
  position: absolute;
  left: calc(50% - 10px);
  top: calc(50% - 10px);
}
/*旋转的小球*/
.bb{
  width: 100px;
  height: 100px;
  background-color: red;
  /*定位，相对body设置绝对定位*/
  position: absolute;
  left: calc(50% + 60px);
  top: calc(50% + 60px);
  border-radius: 50%;
  /*添加动画*/
  /*动画名称*/
  animation-name: xuanzhuan,changeColor;
  animation-duration: 3s;
  animation-iteration-count:infinite;
  /*速率默认ease（慢-快-慢）
      ease-in(慢-快)
      ease-out(快-慢)*/
  animation-timing-function:ease;
  animation-timing-function: cubic-bezier(0.05,0.66,0.28,1.2);
  /*origin赋值为x轴 y轴的坐标点*/
  transform-origin: -60px -60px;
  /*添加变色的动画----不能在这里添加新的动画，旧的会被覆盖，可以将两个动画属性写在一起*/
  /*animation: changeColor 3s linear infinite;*/
}
/*动画规则*/
@keyframes xuanzhuan{
  from{
    transform: rotate(0);
  }
  to{
    transform: rotate(360deg);
  }
}
@keyframes changeColor{
  0%{
    background-color: red;
  }
  20%{
    background-color: forestgreen;
  }
  40%{
    background-color: darkblue;
  }
  60%{
    background-color: tomato;
  }
  80%{
    background-color: mediumvioletred;
  }
  100%{
    background-color: yellow;
  }
}

.cc{
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: beige;
  animation: 1.4s 1s ease-out forwards show, 1.6s 2.4s ease forwards text5, 12s 4s linear infinite wobble;
}
@keyframes show {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@keyframes text5 {
  0% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(0.8);
  }
}
@keyframes wobble {
  0% {
    transform: translateX(0) rotate(0) scale(0.8);
  }
  15% {
    transform: translateX(-100px) rotate(-100deg) scale(0.8);
  }
  30% {
    transform: translateX(200px) rotate(100deg) scale(0.8);
  }
  45% {
    transform: translateX(-200px) rotate(-100deg) scale(0.8);
  }
  60% {
    transform: translateX(200px) rotate(100deg) scale(0.8);
  }
  75% {
    transform: translateX(-200px) rotate(-100deg) scale(0.8);
  }
  100% {
    transform: translateX(0px) rotate(0) scale(0.8);
  }
}
</style>